<ion-view view-title="故障报修">
  <ion-nav-bar class="bar-dark">
    <ion-nav-buttons side="right">
      <button class="button icon ion-qr-scanner" ng-click="scanBarcode();">扫一扫</button>
    </ion-nav-buttons>
  </ion-nav-bar>
  <ion-content scroll="false">
    <div class="list padding">
      <button class="button ion-settings button-block button-positive" ng-click="createOrder();" > 上报故障 </button>
      <div class="item item-icon-right" ng-click="listDevice();">
        {{currentDevice}}
        <i class="icon ion-chevron-right icon-accessory"></i>
      </div>
      <div class="item item-icon-right" ng-click="getPhoto();">
        拍照
        <i class="icon ion-camera"></i>
      </div>

      <label class="item item-input">
        <textarea rows="5" placeholder="请输入设备故障原因" ng-model="order.reason"></textarea>
      </label>
      <!-- Show pictures -->
      <div class="row" ng-repeat="image in images" ng-if="$index % 3 === 0">
        <div class="col col-33" ng-if="$index < images.length">
          <img ng-src="{{images[$index]}}" width="100%" ng-click="onSwipe($index);"/>
        </div>
        <div class="col col-33" ng-if="$index + 1 < images.length">
          <img ng-src="{{images[$index + 1]}}" width="100%" ng-click="onSwipe($index+1);"/>
        </div>
        <div class="col col-33" ng-if="$index + 2 < images.length">
          <img ng-src="{{images[$index + 2]}}" width="100%" ng-click="onSwipe($index+2);"/>
        </div>
      </div>
    </div>
  </ion-content>
</ion-view>
